/**
*@Author 周贞荣
*@Modify 周贞荣
*@Date 2022/3/24 13:56
*@Description 文件功能描述
*/
<template>
    <van-swipe-cell>
        <div class="flex items-center paddingL10 paddingR15 borderB1">
            <slot name="check"></slot>
            <van-image
                    class="marginL10 radius10 overflow-hidden"
                    width="3rem"
                    height="3rem"
                    fit="contain"
                    src="https://img.yzcdn.cn/vant/cat.jpeg"
            />
            <div class="marginL10 flex-full overflow flex flex-column justify-between">
                <div class="over-text-two font14 color03 lh24">鲜花的美丽不在于他的颜色，而在于它时刻改变的盛装,不求简简单单的爱，只求化淤泥时无遗憾</div>
                <div class="flex items-center justify-between">
                    <span class="danger-color font16">￥{{item.price||0}}</span>
                    <slot name="num"></slot>
                </div>
            </div>
        </div>
        <template #right>
            <van-button style="height: 100%" square text="删除" type="danger" class="delete-button"
                        @click.stop="emit('delete')"/>
        </template>
    </van-swipe-cell>
</template>

<script lang="ts" setup>
    import {computed, getCurrentInstance} from "vue";

    const {emit, proxy} = getCurrentInstance();
    // 获取父级属性
    const props = defineProps({
        item: {type: Object, default: {id: '', isCheck: false, num: 0}},
        value: {type: Number, default: 0}
    });

    const num = computed({
        get() {
            return props.value
        },
        set(val) {
            console.log(val);
            emit('input', val)
        }
    });
</script>

<style scoped>

</style>